<html>
  <body>

  </body>
  <script>
    // const callback = (res)=>{
    //   console.log('frons',res)
    // }

    function request(url){

      return new Promise((reslove)=>{

        window.callback=function(resp){
          reslove(resp)
        }

        const script = document.createElement('script')
        script.src =url
        document.body.append(script)
      })
    }

    request('http://localhost:3000/jsonp').then(res=>{
      console.log(res)
    })
  </script>
  <!-- <script src="http://localhost:3000/jsonp"></script> -->
</html>